package com.rabbitmq.demo.mq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author :wn
 * @program : demo
 * @descript :
 * @create :2021-05-08 09:59
 */
@Component
//监听QueueHello的消息队列
@RabbitListener(queues = "Queue1")
public class ReceiverB {
    //@RabbitHandler来实现具体消费
    @RabbitHandler
    public void QueueReceiver(String Queue1) {
        System.out.println("Receiver B: " + Queue1);
    }
}

